﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LowLevelGraphics.Filter
{
    /// <summary>
    /// This will be used to get the correspondence between two pictures.
    /// A correspondence is a point found in pic a that is meant to be the
    /// same point in pic b. 
    /// 
    /// In the ideal case: No matter how different the perspectives are or
    /// varying lighting conditions
    /// 
    /// To do that some extracted features are needed from both pics. 
    /// And the features have then to be matched. The corresponding points
    /// (point a1 -> point b1) will then be stored in this class. 
    /// So the caller is able to extract the corresponding feature pairs
    /// 
    /// Depth/Disparity map in 3d folder uses a similar but easier matching
    /// algorithm. see also there. 
    /// 
    /// So this might be used for the following things:
    /// 
    /// - motion estimation 
    /// - stereo matching (use filter from 3d for better performance)
    /// - picture matching
    /// - perspective matching
    /// - finding a pic in another pic maybe
    /// </summary>
    public class CorrespondenceFilter : BaseImageFilter, ITwoSourceFilter
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="CorrespondenceFilter"/> class.
        /// </summary>
        public CorrespondenceFilter()
        {
        }

        /// <summary>
        /// Initializes a new instance of the <see cref="CorrespondenceFilter"/> class.
        /// </summary>
        /// <param name="_correspondenceFilter">The _correspondence filter.</param>
        internal CorrespondenceFilter(CorrespondenceFilter _correspondenceFilter)
        {
        }

        /// <summary>
        /// Execute this Filter
        /// A Debug Statement is written if a concrete Filter is called
        /// </summary>
        /// <param name="_bitmap"></param>
        /// <returns></returns>
        public override UnsafeBitmap Execute(UnsafeBitmap _bitmap)
        {
            return Process((UnsafeBitmap)_bitmap.Clone(),_bitmap);
        }

        #region ITwoSourceFilter Members

        /// <summary>
        /// Processes the specified bmpimg.
        /// </summary>
        /// <param name="_bitmap1"></param>
        /// <param name="_bitmap2"></param>
        /// <returns></returns>
        public UnsafeBitmap Process(UnsafeBitmap _bitmap1, UnsafeBitmap _bitmap2)
        {
            throw new NotImplementedException();
        }

        #endregion

        /// <summary>
        /// This is used to clone a filter, each filter must implement it's own clone functionality
        /// </summary>
        /// <returns></returns>
        public override object Clone()
        {
            return new CorrespondenceFilter(this);
        }

    }
}
